package com.hsy.crm.web.web.basics;

import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.entity.ProductType;
import com.hsy.crm.web.domain.vo.product.ProductypeSelectVo;
import com.hsy.crm.web.service.impl.ProductTypeService;
import com.hsy.crm.web.web.BaseAction;
import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.entity.ProductType;
import com.hsy.crm.web.domain.vo.product.ProductypeSelectVo;
import com.hsy.crm.web.web.BaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/productType")
public class ProductTypeAction extends BaseAction {

    @Autowired
    ProductTypeService productTypeService;

    @RequestMapping("/insert")
    public String insert(ProductType productType) {
        return Response.body(productTypeService.insertProductType(productType));
    }

    @RequestMapping("/update")
    public String update(ProductType productType) {
        return Response.body(productTypeService.updateProductType(productType));
    }

    @RequestMapping("/delete")
    public String delete(ProductType productType) {
        return Response.body(productTypeService.deleteProductType(productType));
    }

    @RequestMapping("/select")
    public String select(ProductypeSelectVo productypeSelectVo) {
        return Response.body(productTypeService.find(productypeSelectVo));
    }

    @RequestMapping("/get")
    public String get(ProductType productType) {
        return Response.body(productTypeService.selectOne(productType));
    }


}
